package org.ainlolcat.ainscience2.model.filter.impl;

import org.ainlolcat.ainscience2.model.filter.Filter;
import org.jdom.Element;

/**
 * Created by IntelliJ IDEA.
 * User: ain
 * Date: 17.06.12
 * Time: 17:33
 * To change this template use File | Settings | File Templates.
 */
public class ElementNameAttrFilter implements Filter {
    String name;

    public ElementNameAttrFilter(String name) {
        this.name = name;
    }

    public boolean isValid(Object column) {
        if (column instanceof Element){
            return ((Element)column).getAttributeValue("name").equals(name);
        } else{
            return false;
        }
    }
}
